/**
 * 
 */
package fr.gfi.agraf.persistence.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;

/**
 * @author eleve
 * 
 */
@Entity
public class Activite {

	@Id
	@GeneratedValue
	private Long id;

	@Column(nullable = false)
	private String libelle;

	@Type(type="text")
	private String remarque;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dateDebut;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dateFin;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(nullable = false)
	private Date dateCreation;

	@ManyToOne
	@JoinColumn(name = "idPerimetre", nullable = false)
	private Perimetre perimetre;

	@ManyToOne
	@JoinColumn(name = "idEtat", nullable = false)
	private Etat etat;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "activite")
	private Set<Tache> tacheSet;

	/**
	 * @return the listeTache
	 */
	public Set<Tache> getTacheSet() {
		return tacheSet;
	}

	/**
	 * @return the perimetre
	 */
	public Perimetre getPerimetre() {
		return perimetre;
	}

	/**
	 * @param perimetre
	 *            the perimetre to set
	 */
	public void setPerimetre(final Perimetre perimetre) {
		this.perimetre = perimetre;
	}

	/**
	 * @return the etat
	 */
	public Etat getEtat() {
		return etat;
	}

	/**
	 * @param etat
	 *            the etat to set
	 */
	public void setEtat(final Etat etat) {
		this.etat = etat;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(final Long id) {
		this.id = id;
	}

	/**
	 * @return the libelle
	 */
	public String getLibelle() {
		return libelle;
	}

	/**
	 * @param libelle
	 *            the libelle to set
	 */
	public void setLibelle(final String libelle) {
		this.libelle = libelle;
	}

	/**
	 * @return the remarque
	 */
	public String getRemarque() {
		return remarque;
	}

	/**
	 * @param remarque
	 *            the remarque to set
	 */
	public void setRemarque(final String remarque) {
		this.remarque = remarque;
	}

	/**
	 * @return the dateDebut
	 */
	public Date getDateDebut() {
		return dateDebut;
	}

	/**
	 * @param dateDebut
	 *            the dateDebut to set
	 */
	public void setDateDebut(final Date dateDebut) {
		this.dateDebut = dateDebut;
	}

	/**
	 * @return the dateFin
	 */
	public Date getDateFin() {
		return dateFin;
	}

	/**
	 * @param dateFin
	 *            the dateFin to set
	 */
	public void setDateFin(final Date dateFin) {
		this.dateFin = dateFin;
	}

	/**
	 * @return the dateCreation
	 */
	public Date getDateCreation() {
		return dateCreation;
	}

	/**
	 * @param dateCreation
	 *            the dateCreation to set
	 */
	public void setDateCreation(final Date dateCreation) {
		this.dateCreation = dateCreation;
	}

}
